<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">

<ui:composition>

    <p:dialog header="Editar usuário do sistema" widgetVar="edit_login" resizable="false" showEffect="clip" hideEffect="clip" modal="true" position="top" width="440">
        <h:panelGrid id="panel_edit_login" columns="2" style="margin-bottom:10px">

            <h:outputLabel value="Papel: " />
            <h:selectOneMenu value="#{loginDashboardMBean.updateRoleSelected}">
                <f:selectItems value="#{loginDashboardMBean.menuRole}"/>
            </h:selectOneMenu>

            <h:outputLabel value="Banco: " />
            <h:selectOneMenu value="#{loginDashboardMBean.updateBankAccountSelected}">
                <f:selectItems value="#{loginDashboardMBean.menuBankAccount}"/>
            </h:selectOneMenu>

            <h:outputLabel value="Nome: "/>
            <h:inputText value="#{loginDashboardMBean.selectedLogin.name}" size="45" maxlength="45"/>

            <h:outputLabel value="Email: "/>
            <h:inputText value="#{loginDashboardMBean.selectedLogin.email}" size="45" maxlength="45"/>

            <h:outputLabel value="Password: "/>
            <h:inputSecret value="#{loginDashboardMBean.selectedLogin.password}" size="16" maxlength="16"/>

        </h:panelGrid>
        <br/>
        <p:commandButton value="Confirmar" update="growl, pnlLogin" actionListener="#{loginDashboardMBean.updateLogin}" oncomplete="edit_login.hide();"/>
        <p:commandButton value="Cancelar" oncomplete="edit_login.hide();"/>
    </p:dialog>

    <p:dialog header="Criar usuário do sistema" widgetVar="create_login" resizable="false" showEffect="clip" hideEffect="clip" modal="true" position="top" width="440">
        <h:panelGrid id="panel_create_login" columns="2" style="margin-bottom:10px">

            <h:outputLabel value="Papel: " />
            <h:selectOneMenu value="#{loginDashboardMBean.persistRoleSelected}">
                <f:selectItems value="#{loginDashboardMBean.menuRole}"/>
            </h:selectOneMenu>

            <h:outputLabel value="Banco: " />
            <h:selectOneMenu value="#{loginDashboardMBean.persistBankAccountSelected}">
                <f:selectItems value="#{loginDashboardMBean.menuBankAccount}"/>
            </h:selectOneMenu>

            <h:outputLabel value="Nome: "/>
            <h:inputText value="#{loginDashboardMBean.createLogin.name}" size="45" maxlength="45"/>

            <h:outputLabel value="Email: "/>
            <h:inputText value="#{loginDashboardMBean.createLogin.email}" size="45" maxlength="45"/>

            <h:outputLabel value="Password: "/>
            <h:inputSecret value="#{loginDashboardMBean.createLogin.password}" size="16" maxlength="16"/>

        </h:panelGrid>
        <br/>
        <p:commandButton value="Confirmar" update="growl, pnlLogin" actionListener="#{loginDashboardMBean.createLogin}" oncomplete="create_login.hide();"/>
        <p:commandButton value="Cancelar" oncomplete="create_login.hide();"/>
    </p:dialog>

</ui:composition>
</html>